fix: treat Windows App Execution Aliases as executable - #184
Closed
dyk1454683243-sudo wants to merge 1 commit into
Closed
dyk1454683243-sudo wants to merge 1 commit into
dyk1454683243-sudo wants to merge 1 commit into
Conversation
WindowsApps aliases such as mspaint.exe raise EACCES from fs.stat, so isexe reports them as non-executable. After an isexe miss or EACCES/EPERM, treat Microsoft\WindowsApps paths as executable when fs.access succeeds. Co-authored-by: David <dyk1454683243-sudo@users.noreply.github.com>
Author
|
Withdrawing this PR while I clean up a high-volume open-PR backlog. Sorry for the noise — happy to come back later with a focused change if useful. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #157.
Windows 11 App Execution Aliases (for example
%LOCALAPPDATA%\Microsoft\WindowsApps\mspaint.exe) are launchable PATH entries, butfs.stat()raisesEACCES. Publishedisexe@4.0.0then returnsfalse(olderisexecan throw), sowhichmisses them.This keeps
whichcorrect against currentisexeby treating aMicrosoft\WindowsAppspath as executable whenisexemisses or throwsEACCES/EPERMandfs.access()succeeds. Other errors still propagate. POSIX behavior is unchanged.Root-cause fix: isaacs/isexe#42 (
Fixes npm/node-which#157). Related earlier attempt: isaacs/isexe#40. Thiswhichchange does not wait on anisexerelease.Tests cover alias hits, absolute paths,
EACCES/EPERMfromisexe, unexpected errors, missing alias files, non-WindowsApps paths, POSIX, and{ all: true }. Suite stays at 100% coverage.